#!/bin/bash

exec 1>> /var/tmp/fwall.log 2>&1

IPTABLES=/sbin/iptables

IPADDR=$1
ACTION=$2

if [ $# -ne "2" ]
then
	echo -e "\nSyntax is:\t $0 ip-address lower,raise\n"
	exit 0
fi


lower() {
        echo -e "\n`date` Lowering the firewall $IPADDR\n"

	# Do IPTABLES stuff here to drop the firewall when user logs in
	
        exit 1
}


raise() {
        echo -e "\n`date` Raising the firewall $IPADDR\n"

	# Do IPTABLES stuff here to raise firewall when user logs out
	
        exit 1
}


case $ACTION in
lower ) lower ;;
raise ) raise ;;
esac
